namespace RivercrabNet
{
    using System;
    using System.Drawing;

    public class OffSetMenu
    {
        private bool beginMoveFlag;
        private Color bgColor = Color.White;
        private Color borderColor = Color.Gray;
        private double curStep = 1.0;
        private Point locaition = new Point(40, 10);
        private double maxStep = 100000.0;
        private double minStep = 0.0001;

        public Rectangle GetChangeRangeRect()
        {
            return new Rectangle(this.GetUpRect().X - 2, ((this.GetRangeUpRect().Bottom + this.CurRangeHeight) + 2) - 10, 0x16, 8);
        }

        public double GetCurStepByMousePoint(Point mp)
        {
            Rectangle rectangle = new Rectangle(this.GetRangeUpRect().Left, this.GetRangeUpRect().Bottom, 14, this.RangeHeight);
            if (!rectangle.Contains(mp))
            {
                return this.curStep;
            }
            int num = (mp.Y - this.GetRangeUpRect().Bottom) / 10;
            double minStep = this.minStep;
            for (int i = 0; i < num; i++)
            {
                minStep *= 10.0;
            }
            return minStep;
        }

        public Rectangle GetDefaultButtonRect()
        {
            return new Rectangle(new Point(this.Locaition.X + 20, this.GetRangeDownRect().Bottom + 5), new Size(0x12, 0x12));
        }

        public Rectangle GetDownRect()
        {
            return new Rectangle(new Point(this.Locaition.X + 20, this.Locaition.Y + 40), new Size(0x12, 0x12));
        }

        public Rectangle GetLeftRect()
        {
            return new Rectangle(new Point(this.Locaition.X, this.Locaition.Y + 0x13), new Size(0x12, 0x12));
        }

        public Rectangle GetMoveRect()
        {
            return new Rectangle(new Point(this.Locaition.X, this.Locaition.Y), new Size(10, 10));
        }

        public Rectangle GetRangeDownRect()
        {
            return new Rectangle(new Point(this.Locaition.X + 20, this.GetRangeUpRect().Bottom + this.RangeHeight), new Size(0x12, 4));
        }

        public Rectangle GetRangeUpRect()
        {
            return new Rectangle(new Point(this.Locaition.X + 20, this.GetDownRect().Bottom + 5), new Size(0x12, 4));
        }

        public Rectangle GetRightRect()
        {
            return new Rectangle(new Point(this.Locaition.X + 40, this.Locaition.Y + 0x13), new Size(0x12, 0x12));
        }

        public Rectangle GetUpRect()
        {
            return new Rectangle(new Point(this.Locaition.X + 20, this.Locaition.Y), new Size(0x12, 0x12));
        }

        public bool BeginMoveFlag
        {
            get
            {
                return this.beginMoveFlag;
            }
            set
            {
                this.beginMoveFlag = value;
            }
        }

        public Color BgColor
        {
            get
            {
                return this.bgColor;
            }
            set
            {
                this.bgColor = value;
            }
        }

        public Color BorderColor
        {
            get
            {
                return this.borderColor;
            }
            set
            {
                this.borderColor = value;
            }
        }

        public int CurRangeHeight
        {
            get
            {
                double num = this.curStep / this.minStep;
                return (num.ToString().Length * 10);
            }
        }

        public double CurStep
        {
            get
            {
                return this.curStep;
            }
            set
            {
                this.curStep = value;
            }
        }

        public Point Locaition
        {
            get
            {
                return this.locaition;
            }
            set
            {
                this.locaition = value;
            }
        }

        public double MaxStep
        {
            get
            {
                return this.maxStep;
            }
            set
            {
                this.maxStep = value;
            }
        }

        public double MinStep
        {
            get
            {
                return this.minStep;
            }
            set
            {
                this.minStep = value;
            }
        }

        public int RangeHeight
        {
            get
            {
                double num = this.MaxStep / this.minStep;
                return (num.ToString().Length * 10);
            }
        }
    }
}

